from google.appengine.ext import db

class Document(db.Model) :
    title = db.StringProperty(required=True)
    type = db.StringProperty(required=True)
    date = db.DateProperty(required=True)    
    id = db.IntegerProperty
    
    def getJSON(self):
        return {
            "title" : self.title,
            "type" : self.type,
            "date" : self.date.isoformat(),
            "id" : self.id
        }
        